package com.jenkins.controller;

import com.jenkins.model.Users;
import com.jenkins.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Mr.Yu
 * @Date: 2021/3/28 17:01
 * @description
 * @Version 1.0
 */
@Controller
public class UserServiceController {

    @Autowired
    private UserService userService;

    @ResponseBody
    @GetMapping("list")
    public Object list(Model model) {
        List<Users> list = userService.list();
        model.addAttribute("list", list);
        return "list";
    }
}

